function close_plan(){
    window.close();
}
function collection(){
    var flag =confirm("移动收藏后,将不再购物车显示,是否继续操作?");
    if(flag==true){
        alert("移动收藏成功!")
    }
}
function del(){
    var flag =comfirm("您确定要删除商品吗?");
    if(flag==true){
        alert("删除成功!");
    }
}
function minus(num){                          //爆红区域因为没有调用到，在主体部分调用
                   var prices=document.getElementsByName("price")[num].value;
                   var count=parseInt(document.getElementsByName("amount")[num].value)-1;
                   if(count<1){
                    alert("不能在减了，我已经被掏空了");
                   }else{
                       document.getElementsByName("amount")[num].value=count;
                       var totals=parseFloat(prices*count);
                       document.getElementById("price"+num).innerHTML="￥"+totals;
                       }
                   }
                    function plus(num){
                        var prices=document.getElementsByName("price")[num].value;
                        var count=parseInt(document.getElementsByName("amount")[num].value)+1;
                        document.getElementsByName("amount")[num].value=count;
                        var totals=parseFloat(prices*count);
                        document.getElementById("price"+num).innerHTML="￥"+totals;
                        total();
                    }
                    function total(){
                        var prices=document.getElementsByName("price");
                        var count=document.getElementsByName("amount");
                        var sum=0;
                        for(var i =0;i<prices.length;i++){
                            sum+=prices[i].value*count[i].value;
                        }
                        document.getElementById("totalPrice").innerHTML="¥"+sum.toFixed(2);
                    }
                    total();